package com.sxbang.friday.controller.api;

import com.sxbang.friday.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("${api:url}")//可以在yml文件中设置别名
@Slf4j
public class ApiController {
    @Autowired
    UserService userService;
    @GetMapping("/getPage")//返回pageName页面
    public ModelAndView user(ModelAndView modelAndView,String pageName){//需要返回一个页面的时候饭后modelAndView
       modelAndView.setViewName(pageName);
        return modelAndView;
    }

}
